package com.houweishi.module.addressBook.service.impl;

import java.util.List;
import com.houweishi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.houweishi.module.addressBook.mapper.AddressBookMapper;
import com.houweishi.module.addressBook.domain.AddressBook;
import com.houweishi.module.addressBook.service.IAddressBookService;

/**
 * 通讯录页面Service业务层处理
 * 
 * @author yqq
 * @date 2023-06-27
 */
@Service
public class AddressBookServiceImpl implements IAddressBookService 
{
    @Autowired
    private AddressBookMapper addressBookMapper;

    /**
     * 查询通讯录页面
     * 
     * @param id 通讯录页面主键
     * @return 通讯录页面
     */
    @Override
    public AddressBook selectAddressBookById(Long id)
    {
        return addressBookMapper.selectAddressBookById(id);
    }

    /**
     * 查询通讯录页面列表
     * 
     * @param addressBook 通讯录页面
     * @return 通讯录页面
     */
    @Override
    public List<AddressBook> selectAddressBookList(AddressBook addressBook)
    {
        return addressBookMapper.selectAddressBookList(addressBook);
    }

    /**
     * 新增通讯录页面
     * 
     * @param addressBook 通讯录页面
     * @return 结果
     */
    @Override
    public int insertAddressBook(AddressBook addressBook)
    {
        addressBook.setCreateTime(DateUtils.getNowDate());
        return addressBookMapper.insertAddressBook(addressBook);
    }

    /**
     * 修改通讯录页面
     * 
     * @param addressBook 通讯录页面
     * @return 结果
     */
    @Override
    public int updateAddressBook(AddressBook addressBook)
    {
        addressBook.setUpdateTime(DateUtils.getNowDate());
        return addressBookMapper.updateAddressBook(addressBook);
    }

    /**
     * 批量删除通讯录页面
     * 
     * @param ids 需要删除的通讯录页面主键
     * @return 结果
     */
    @Override
    public int deleteAddressBookByIds(Long[] ids)
    {
        return addressBookMapper.deleteAddressBookByIds(ids);
    }

    /**
     * 删除通讯录页面信息
     * 
     * @param id 通讯录页面主键
     * @return 结果
     */
    @Override
    public int deleteAddressBookById(Long id)
    {
        return addressBookMapper.deleteAddressBookById(id);
    }
}
